#include <stdio.h>
#include <stdlib.h>
#include <string.h>


/* 数组大小 */
#define SIZE	13141
#define BUFFSIZE 1024

int main()
{
	FILE* fp;
	char buf[BUFFSIZE];
	int count = 0;

	if((fp = fopen("bmp_ptr_arr.h", "w")) < 0)
	{
		perror("fopen()");
	}

	strcpy(buf, "gImage_");
	fwrite("const unsigned char* badapple_arr[] = { ", strlen("const unsigned char* badapple_arr[] = { "), 1, fp);

	for(int i = 1; i <= SIZE; i++)
	{
		sprintf(buf + strlen("gImage_"), "%d", i);
		fwrite(buf, strlen(buf), 1, fp);
		if(i < SIZE)
			fwrite(", ", 2, 1, fp);

		if (count++ > 50)
		{
			fwrite("\n", 1, 1, fp);
			count = 0;
		}
	}
	fwrite(" };", 3, 1, fp);



	fclose(fp);
	return 0;
}
